// 统一请求路径前缀在libs/axios.js中修改
import {
  getRequest,
  putRequest,
  postRequest,
  deleteRequest
} from "@/libs/axios";

// 列表
export const getlist = params => {
  return getRequest("/article/getByPage", params);
};

// 新增
export const getaddlist = params => {
  return postRequest("/article", params, {
    "Content-Type": "application/json"
  });
};

// 详情
export const getdetlist = id => {
  return getRequest(`/article/${id}`);
};

// 编辑
export const geteditlist = (id, params) => {
  return putRequest(`/article/update/${id}`, params, {
    "Content-Type": "application/json"
  });
};

// 删除
export const getdellist = id => {
  return deleteRequest(`/article/${id}`);
};
